﻿using FluentNHibernate.Mapping;

namespace ControleRepresentante.Logic.Models.Maps
{
    public class DetailsHolderMap : SubclassMap<DetailsHolder>
    {
        public DetailsHolderMap()
        {
            HasMany(x => x.Contatos)
                .Inverse()
                .Access.PascalCaseField(Prefix.mUnderscore)
                .Cascade.AllDeleteOrphan();
            HasMany(x => x.Enderecos)
                .Inverse()
                .Access.PascalCaseField(Prefix.mUnderscore)
                .Cascade.AllDeleteOrphan();
            HasMany(x => x.Contas)
                .Inverse()
                .Access.PascalCaseField(Prefix.mUnderscore)
                .Cascade.AllDeleteOrphan();
        }
    }
}
